<%-- 
    Document   : editUser
    Created on : 02-03-2012, 16:23:53
    Author     : Huy Cuong Do
--%>

<%@page import="Model.DAO"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@include file="../WEB-INF/jspf/headeradmin.jspf" %>
       
        
        <style type="text/css" title="currentStyle">
            @import "datatable/demo_page.css";
            @import "datatable/demo_table_jui.css";
            @import "datatable/jquery-ui-1.8.4.custom.css";
        </style>
        <script type="text/javascript" language="javascript" src="datatable/jquery.js"></script>
        
        <script type="text/javascript" language="javascript" src="datatable/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                oTable = $('#userTable').dataTable({
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers"
                });
            } );
        </script>       
  
      
        <%
                    Connection connection = DAO.getConnection();
                    String sql = "select * from user";
                    PreparedStatement preparedStatement = connection.prepareStatement(sql);
                    ResultSet rs = preparedStatement.executeQuery();


        %>
        
        <table width="525" border="1" class="display" id="userTable">
            <thead>
            <th>Số Thứ Tự</th>
            <th>Username</th>
            <th>Họ và Tên</th>
            <th>Role</th>  
            <th>Xác Nhận</th>
        </thead>
        <tbody>
            <%
                        int i = 0;
                        while (rs.next()) {
                            i++;
                            String username=rs.getString("username");
            %>

            <tr class="gradeC">
                <td><%=i + ""%></td>
                <td><%=username%></td>
                <td><%=rs.getString("fullname")%></td>
                <td align = "center"><%=rs.getString("role")%></td>
                <td align = "center">
                    <label>
                        <input type="button" name="btSua" id="submit" value="Sửa" onclick="window.location='/LaptopShop/EditUser?user=<%=username%>'"/>
                    </label>
                </td>

               

            </tr>
            <%
                }
            %>
        </tbody>
    </table>
            
<%@include file="../WEB-INF/jspf/footeradmin.jspf" %>
